In a network virtualization environment, one of the more common applications deployed on hypervisors are 3-tier apps, in which a web-tier, a database-tier, and app-tier are on different L3 subnets. This requires IP (internet protocol) packets traversing from one virtual machine (VM) in one subnet to another VM in another subnet to first arrive at a L3 router, then forwarded to the destination VM using L2 MAC (media access control) address. This is true even if the destination VM is hosted on the same host machine as the originating VM. This generates unnecessary network traffic and causes higher latency and lower throughput, which significantly degrades the performance of the application running on the hypervisors. Generally speaking, this performance degradation occurs whenever any two VMs in two different network segments (e.g., different IP subnet, different L2 segments, or different overlay logical networks) communicate with each other.
FIG. 1 illustrates a logical network implemented over a network virtualization infrastructure 100, in which virtual machines (VMs) 121-129 belonging to different network segments communicate with each other through a shared L3 router 110. The VMs 121-129 are running on host machines 131-133, which are physical machines communicatively linked with each other and to the shared L3 router 110 by a physical network 105. A VM in network segment A can only communicates with a VM in network segment B through the physical network 105 and the shared L3 router 110, whether the VMs are in different host machines (e.g., from the VM 122 to the VM 127) or in the same host machine (e.g., from the VM 125 to the VM 126).
U.S. patent application Ser. No. 14/137,862, filed on Dec. 20, 2013, describes a logical router element (LRE) that operates distributively across different host machines as a virtual distributed router (VDR). Each host machine operates its own local instance of the LRE as a managed physical routing element (MPRE) for performing L3 packet forwarding for the VMs running on that host. The LRE therefore makes it possible to forward data packets locally (i.e., at the originating hypervisor) without going through a shared L3 router.
Furthermore, an LRE as described by U.S. patent application Ser. No. 14/137,862 not only performs L3 routing for VMs operating in host machines that operate the LRE, but also performs L3 routing for physical routers/hosts or other network nodes that do not operate the LRE. One particular host machine operating the LRE is selected as the designated host machine, and its MPRE is the designated instance of the LRE for handling L3 routing of traffic from the physical routers.